<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>新增客户</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="bootstrap-style" href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/bootstrap-responsive.min.css"/>" rel="stylesheet">
	<link id="base-style" href="<c:url value="/css/style.css"/>" rel="stylesheet">
	<link id="base-style-responsive" href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
	<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">
	<link href="<c:url value="/css/page.css"/>" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/jquery.datetimepicker.css"/>"/>
	<link href="<c:url value="/css/navuser.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/but.css"/>" rel="stylesheet">
	<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
	<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/layer/layer.js"/>"></script>
	<script src="<c:url value="/js/laydate/laydate.js"/>"></script>
	<script src="<c:url value="/js/build/jquery.datetimepicker.full.js"/>"></script>
	<script src="<c:url value="/js/orgin.js"/>"></script>
	<script src="<c:url value="/js/filebut.js"/>"></script>
</head>
 <script type="text/javascript">
 function closebutton() {
		var index = parent.layer.getFrameIndex(window.name);  
	 	parent.layer.close(index);  
	 }
 function save(){
     var formData = new FormData($("#customerform")[0]);
     $.ajax({  
          url: '<%=basePath%>crm/save',
          type: 'POST',  
          data: formData,  
          async: false,  
          cache: false,
          contentType: false,  
          processData: false,  
          success: function (result) {
                if("addok"==result){
                    alert("添加客户成功");
                    closebutton();
                    window.parent.location.reload(); //刷新父页面
                }else if("addno"==result){
                    alert("添加客户失败");
                }else if("updateok"==result){
                	alert("修改客户成功");
                    closebutton();
                    window.parent.location.reload(); //刷新父页面
                }else if("updateno"==result){
                	alert("修改客户失败");
                }else if("custNameExist"==result){
                	alert("客户名已经存在");
                }else if("custIsBracket"==result){
                	alert("该客户已封档");
                }
          }
     });
 }
 $(function(){
	/*  $("#layui-layer-content").attr("height","1000px");
	 $("#layui-layer-iframe1").attr("width","1000px");
	 $("#layui-layer-iframe1").attr("height","1000px");
	 $("#memo").attr("rows","1"); */
	 
 })
	 </script>
		<body>
	
			<div id="content" class="span10" style="width: 100%;background-color:#F9F9F9;">
				
				<div style="background-color:#FFF;height: 1200px">
				
				<form name="customerform" id="customerform" method="post">
					<input type="hidden" name="id" value="${customerid }">
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<tbody>
								<tr>
									<td>公司名</td>
									<td><input style="margin-left: -152px;" type="text" id="custName" name="custName" value="${cus.custName }"></td>
								</tr>
								<tr>
									<td>邮政编码</td>
									<td><input style="margin-left: -152px;" type="text" id="custZip" name="custZip" value="${cus.custZip }"></td>
								</tr>
								<tr>
									<td>电话</td>
									<td><input style="margin-left: -152px;" type="text" id="custTel" name="custTel" value="${cus.custTel }"></td>
								</tr>
								<tr>
									<td>网址</td>
									<td><input style="margin-left: -152px;" type="text" id="custWebsite" name="custWebsite" value="${cus.custWebsite }"></td>
								</tr>
								<tr>
									<td>所属行业</td>
									<td><input style="margin-left: -152px;" type="text" id="industry" name="industry" value="${cus.industry }"></td>
								</tr>
								<tr>
									<td>推荐人</td>
									<td><input style="margin-left: -152px;" type="text" id="introducer" name="introducer" value="${cus.introducer }"></td>
								</tr>
								<tr>
									<td>地址</td>
									<td>
										<input style="width: 360px;" type="text" id="custAddress" name="custAddress" value="${cus.custAddress }"></td>
								</tr>
								<tr>
									<td>备注</td>
									<td><textarea style="width: 360px;" rows="6" cols="" id="memo" name="memo">${cus.memo }</textarea></td>
								</tr>
								</tbody>
								<tbody>
								<tr>
									<td>联系人姓名</td>
									<td><input style="margin-left: -152px;" type="text" id="lkmName" name="lkmName" value="${lkm.lkmName }"></td>
								</tr>
								<tr>
									<td>性别</td>
									<td>
										<c:if test="${lkm.lkmSex == 2 }">
					                  	  	<input style="margin-left: -152px;" name="lkmSex" type="radio" value="1">男
					                  	  	<input name="lkmSex" type="radio" value="2" checked="checked">女
					                  	  </c:if>
					                  	  <c:if test="${lkm.lkmSex == 1 || lkm.lkmSex eq null }">
					                  	  	<input style="margin-left: -152px;" name="lkmSex" type="radio" value="1">男
					                  	  	<input name="lkmSex" type="radio" value="2">女
					                  	  </c:if>
									</td>
								</tr>
								<tr>
									<td>联系人职位</td>
									<td><input style="margin-left: -152px;" type="text" id="lkmPostion" name="lkmPostion" value="${lkm.lkmPostion }"></td>
								</tr>
								<tr>
									<td>办公电话</td>
									<td><input style="margin-left: -152px;" type="text" id="lkmTel" name="lkmTel" value="${lkm.lkmTel }"></td>
								</tr>
								<tr>
									<td>手机</td>
									<td><input style="margin-left: -152px;" type="text" id="lkmMobile" name="lkmMobile" value="${lkm.lkmMobile }"></td>
								</tr>
								<tr>
									<td>邮箱</td>
									<td><input style="margin-left: -152px;" type="text" id="lkmEmail" name="lkmEmail" value="${lkm.lkmEmail }"></td>
								</tr>
								<tr>
									<td>备注</td>
									<td><textarea style="width: 360px;" rows="6" cols="" id="lkmMemo" name="lkmMemo">${lkm.lkmMemo }</textarea></td>
								</tr>
							</tbody>
						</table>
					</div>
				</form>
			<div class="row-fluid content-table">
					<table class="table  bootstrap-datatable" style=" border:none; border-spacing:0; border-collapse:collapse;margin:0;padding:0;">
					  <tbody>
						<tr class="content-search" style="text-align: center;">
							<td colspan="6">
								<div>
									<button style="background-color: #dadada;color: #666;" type="button" onclick="closebutton();" id="output1">取消</button>
									<button class="but" onclick="save();">保存</button>
								</div>
							</td>
						</tr>
					  </tbody>
				  </table>            
				</div>
			</div>
		</div>	
		
		
</body>
</html>
